<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../js/vue.js"></script>
<div id="app">
    <h2>当前计数器{{counter}}</h2>
    <button @click="incre">+</button>
    <button @click="decre">-</button>
</div>
<script>
    let app =new Vue({
        el:'#app',
        data:{
            counter:0
        },
        methods:{
            incre:function (){
                this.counter++;
                console.log("incre被执行列");
            },
            decre:function (){
                this.counter--
                console.log("decre被执行列");
            }
        }
    })
</script>

</body>
</html>